import { PaymentChannel } from '@prisma/client';

// 渠道配置接口
export interface ChannelConfig {
  channelId: string;
  channelName: string;
  displayName: string;
  weight: number;
  isEnabled: boolean;
  minAmount: number;
  maxAmount: number;
  dailyLimit: number;
  priority: number;
}

// 完整的渠道权重配置结构
export interface ChannelWeightConfig {
  version: string;
  lastUpdated: string;
  defaultConfig: {
    algorithm: 'weighted_random' | 'round_robin' | 'priority';
    fallbackStrategy: 'round_robin' | 'priority' | 'random';
  };
  channels: Record<PaymentChannel, ChannelConfig>;
}

// 渠道选择结果
export interface ChannelSelectionResult {
  selectedChannel: PaymentChannel | null;
  reason: string;
  availableChannels: PaymentChannel[];
  totalWeight: number;
  selectionWeight?: number;
}

// 测试渠道选择结果
export interface ChannelTestResult {
  testCount: number;
  amount: number;
  results: Record<PaymentChannel, number>;
  percentages: Record<PaymentChannel, number>;
  totalWeight: number;
  duration: number;
}